<script>
	import Vue from 'vue'
	export default {
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;//右上角胶囊信息
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;
					Vue.prototype.barHeight = e.statusBarHeight + custom.height + (custom.top - e.statusBarHeight) * 2;//自定义头部导航栏的高度
					Vue.prototype.capsuleTop = custom.top;//全局定义左上角胶囊的距离顶部的高度
					Vue.prototype.capsuleWidth =  e.windowWidth - custom.right + custom.width;//全局定义左上角胶囊的宽度
					Vue.prototype.capsuleHeight = custom.height;//全局定义左上角胶囊的高度
					Vue.prototype.capsuleLeft = e.windowWidth - custom.right;//全局定义左上角胶囊的与右边的距离
					// #endif		

					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>